package admin.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zgb
 * @date 2024-04-01 12:27
 * @description TODO
 */
@AllArgsConstructor
@Getter
public enum TokenStoreType {


    JWT(0, "JWT无状态"),
    IN_MEMORY(1, "jdk内存有状态"),
    JDBC(2, "数据库有状态"),
    JWK(3, "JWK无状态"),
    REDIS(4, "redis有状态");

    private int code;
    private String message;

    public static TokenStoreType get(int code) {
        for (TokenStoreType type : TokenStoreType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;

    }
}
